package cn.kgc.jdktest.demo10;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.stream.Stream;

/**
 * @Author:yaozhaobao
 * @Description:TODO
 * @version:1.0
 */
public class Test {

    public static void main(String[] args) {

        // List
        ArrayList<String> list = new ArrayList<>();
        Stream<String> stream1 = list.stream();

        // Set
        HashSet<String> set = new HashSet<>();
        Stream<String> stream2 = set.stream();

        // Map
        HashMap<String, Integer> map = new HashMap<>();
        // 所有键
        Stream<String> stream3 = map.keySet().stream();
        // 所有值
        Stream<Integer> stream4 = map.values().stream();
        // 所有键值对
        Stream<Map.Entry<String, Integer>> stream5 = map.entrySet().stream();

        // 数组(必须是引用数据类型的数组)
        Integer[] arr = {1, 2, 3, 4};
        Stream<Integer> stream6 = Stream.of(arr);

        // 一堆数据
        Stream<String> stream7 = Stream.of("a", "b", "c");

    }

}
